package chapter4;

import org.eclipse.jface.window.ApplicationWindow;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;

public class WidgetWindow extends ApplicationWindow{
	public WidgetWindow() {
		super(null);
	}
	
	@Override
	protected Control createContents(Composite parent) {
		TabFolder tf = new TabFolder(parent, SWT.NONE);
		
		TabItem chapter3 = new TabItem(tf, SWT.NONE);
		chapter3.setText("chapter3");
		chapter3.setControl(new chapter3.Ch3_Composite(tf));
		
		TabItem	chapter4 = new TabItem(tf, SWT.NONE);
		chapter4.setText("chapter4");
		chapter4.setControl(new Composite_(tf));
		
		getShell().setText("Widget Window");
		return parent;
	}
	
	public static void main(String[] args) {
		WidgetWindow win = new WidgetWindow();
		win.setBlockOnOpen(true);
		
		win.open();
		
		Display.getCurrent().dispose();
	}

}
